﻿jQuery(document).ready(function () {
    
    $('#frPersonalPositionInfo').submit(function () {
        $('#msg-personalpositioninfo').html('');
        App.blockUI($('#frPersonalPositionInfo'), false);
        $.ajax({
            type: "POST",
            url: "/PersonalPosition/AddPersonalPositionInfo",
            data: $(this).serialize(),
            success: function (data) {
                $('#msg-personalpositioninfo').html(data);
                App.unblockUI($('#frPersonalPositionInfo'));
            },
            error: function (xhr, ajaxOptions, thrownError) {
                $('#msg-personalpositioninfo').html("Load failed");
                App.unblockUI($('#frPersonalPositionInfo'));
            }
        });
        return false;
    });



});
function GetPositionByDepartment(departmentid)
{
    $.ajax({
        type: "GET",
        url: "/PersonalPosition/GetPositionByDepartment",
        data: { departmentid: departmentid },
        success: function (data) {
            $("#lbxPosition").html('');
            $.each(data, function (id, option){
                $("#lbxPosition").append($('<option></option>').val(option.id).html(option.name));
            });
            
        },
        error: function (xhr, ajaxOptions, thrownError) {
        }
    });
}